package org.support.small.mallms.service;

import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import org.springframework.stereotype.Service;
import org.support.small.infrastructure.mapper.BannersMapper;
import org.support.small.infrastructure.website.Banners;

import javax.annotation.Resource;

@Service
public class BannersService {
    @Resource
    private BannersMapper bannersMapper;

    public void search(Page<Banners> page, QueryWrapper queryWrapper) {
        bannersMapper.paginate(page, queryWrapper);
    }

    public Banners get(Long id) {
        return bannersMapper.selectOneById(id);
    }

    public void delete(Long id) {
        bannersMapper.deleteById(id);
    }

    public void save(Banners banners) {
        bannersMapper.insertOrUpdateSelective(banners);
    }
}
